package com.ysuedu.service.impl;

import com.ysuedu.dao.UserDao;
import com.ysuedu.entity.User;
import com.ysuedu.service.UserService;

public class UserServiceImpl implements UserService {
    UserDao dao=new UserDao();

    public boolean register(User user) {
        if (!dao.checkAccountValid(user.getUserAccount())){
            dao.insert(user);
            return true;
        }else {
            return false;
        }
    }

    public User login(String account, String pwd) {
        return dao.findUserByAccAndPwd(account,pwd);
    }

}
